﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUCVisitorSpaceLeftUserInfo.ascx.cs"
    Inherits="NJL.Web.Controls.WUCVisitorSpaceLeftUserInfo" %>
<!--个人资料-->
<div class="boxgreen">
    <div class="titlePerson">
        <h2>
            <a>个人资料</a></h2>
    </div>
    <div class="cont">
        <!--头像-->
        <div class="center">
            <asp:Image ID="Image1" runat="server" Width="108px" Height="80px" class="picBor"
                BorderWidth="1" />
        </div>
        <div class="lineinfo">
            <p class="name">
                <asp:Literal ID="litName" runat="server"></asp:Literal></p>
            <p>
                性别：
                <asp:Literal ID="litSex" runat="server"></asp:Literal></p>
            <p>
                积分：<asp:Literal ID="litScore" runat="server"></asp:Literal>分</p>
        </div>
        <!--留言-->
        <div class="messageinfo">
            <span><a target="_blank" href="/wanjia/<%=Request.QueryString["uid"] %>-ly.html"
                class="messagelink">我要留言</a></span> <span>
                    <%
                        if (UserId != "" && UserId == Request.QueryString["uid"])
                        {
                            
                    %>
                      <a class="attionlink"  href="/wanjia/<%=Request.QueryString["uid"] %>-gz.html">
                        查看关注</a>
                    <%
                        }
                        else
                        {
                            if (isFriend == "")
                            {
                    %>
                    <a class="attionlink" id="attention" href="javascript:AddUser('<%=Request.QueryString["uid"] %>')">
                        添加关注</a>
                    <%
}
                        else if (isFriend == "true")
                        {
                    %>
                    <a class="attionlink" id="deleteFriend" href="javascript:DeleteUser('<%=Request.QueryString["uid"] %>')">
                        取消关注</a>
                    <%
                        }
                        }                           
                    %>
                </span>
        </div>
        <script type="text/javascript">
            function AddUser(userid) {
                $.ajax({
                    type: 'get',
                    url: '/Handle/Handler.ashx',
                    data: 'userid=' + userid + '&Random=' + Math.random(),
                    dataType: 'text',
                    success: function (msg) {
                        if (msg == "true") {
                            alert("添加关注成功")
                            window.location.reload();
                        }
                        else {
                            if (msg == "nologin") {
                                document.location.href = '/Login.aspx?url=' + location.href;
                            }
                        }
                    },
                    error: function () {
                        alert("添加关注失败");
                    }
                })
            }
            function DeleteUser(userid) {
                $.ajax({
                    type: 'get',
                    url: '/Handle/Handler.ashx',
                    data: 'deleteFriend=' + userid + '&Random=' + Math.random(),
                    dataType: 'text',
                    success: function (msg) {
                        if (msg == "true") {
                            alert("取消关注成功");
                            window.location.reload();

                        }
                    },
                    error: function () {

                    }
                })
            }
        </script>
    </div>
</div>
